package com.atguigu.upp.mapper;

import com.atguigu.upp.bean.TaskTagRule;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by Smexy on 2022/11/30
 */
public interface TaskTagRuleMapper
{
    //根据taskId 查询 拥有四级标签的三级标签的结果映射规则
    @Select(" SELECT" +
        "   t2.*,tag_name subTagValue  " +
        "FROM" +
        "(SELECT id,tag_name FROM tag_info ) t1  " +
        "JOIN  " +
        "(SELECT * FROM `task_tag_rule` WHERE task_id = #{id}) t2  " +
        "ON t1.id = t2.sub_tag_id")
    List<TaskTagRule> getTaskTagRulesByTaskId(@Param("id") Long taskId);
}
